package net.rcan.web.sample.rest;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/test")
public class TestController {

	@ResponseBody
	@RequestMapping(method = RequestMethod.POST)
	public Map<String, Object> postTest() {

		Map<String, Object> returnData = new HashMap<String, Object>();
		returnData.put("result", "post test");
		return returnData;

	}

	@ResponseBody
	@RequestMapping(method = RequestMethod.DELETE)
	public Map<String, Object> delteTest() {

		Map<String, Object> returnData = new HashMap<String, Object>();
		returnData.put("result", "delete test");
		return returnData;

	}

	@ResponseBody
	@RequestMapping(method = RequestMethod.GET)
	public Map<String, Object> getTest() {

		Map<String, Object> returnData = new HashMap<String, Object>();
		returnData.put("result", "get test");
		return returnData;

	}

	@ResponseBody
	@RequestMapping(method = RequestMethod.PUT)
	public Map<String, Object> putTest() {

		Map<String, Object> returnData = new HashMap<String, Object>();
		returnData.put("result", "put test");
		return returnData;

	}

	@ResponseBody
	@RequestMapping(value = "/1", method = RequestMethod.GET)
	public Map<String, Object> putTestA() {

		Map<String, Object> returnData = new HashMap<String, Object>();
		returnData.put("result", "get test 1");
		return returnData;

	}

}
